package main

import (
	"dfs/client"
	"fmt"
)

func log(order int, step string, success bool) {
	fmt.Printf("[Step %d] Info:%s Result:%t\n", order, step, success)
}

func main() {
	var c client.DfsClient
	log(1, "连接master", c.Connect("127.0.0.1", 8888))
	log(2, "创建文件夹/demo", c.Mkdir("/demo"))
	log(3, "上传文件", c.Put("/Users/ayaka/Desktop/demo.txt", "/demo/demo.txt"))
	log(4, "下载文件", c.Get("/demo/demo.txt", "/Users/ayaka/Downloads/demo.txt"))
	log(5, "删除文件", c.Del("/demo/demo.txt", true))
	log(6, "删除文件夹", c.Del("/demo", false))
	c.Close()
}
